Remove the AI Brand Insights modals from the Yoast SEO installation - #23439
Conversation
…te introduction logic to prevent display on fresh sites.
There was a problem hiding this comment.
Pull request overview
This PR disables the “Discover Brand Insights now” post-install introduction modal in Yoast SEO to improve the first-run experience on fresh sites, and avoids UI competition with upcoming onboarding flows.
Changes:
- Disables the PHP introduction by making
AI_Brand_Insights_Post_Launch::should_show()always returnfalse(and marks related methods as@codeCoverageIgnore). - Unregisters the introduction’s JS modal component from the introductions component map.
- Removes the now-obsolete unit test for the post-launch introduction.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
tests/Unit/Introductions/Application/AI_Brand_Insights_Post_Launch_Test.php |
Removes unit tests that are no longer applicable after disabling the introduction. |
src/introductions/application/ai-brand-insights-post-launch.php |
Permanently disables the post-launch introduction via should_show(): false and annotates methods for coverage exclusion. |
packages/js/src/introductions/initialize.js |
Removes the post-launch modal from the JS initialComponents map so it can’t be rendered client-side. |
| const initialComponents = { | ||
| "ai-brand-insights-free-trial": AiBrandInsightsFreeTrial, | ||
| "ai-brand-insights-post-launch": AiBrandInsightsPostLaunch, | ||
| "black-friday-announcement": BlackFridayAnnouncement, | ||
| "delayed-premium-upsell": DelayedPremiumUpsell, | ||
| "schema-aggregator-announcement": SchemaAggregatorAnnouncement, |
There was a problem hiding this comment.
Keeping it for consistency with the already-disabled ai-brand-insights-pre-launch.js, which is likewise left in place (unreferenced) while its introduction is off. Makes re-enabling trivial and keeps the two AIBI modals symmetric.
There was a problem hiding this comment.
Updated: we've now deleted the unused component files (post-launch, free-trial, and the already-disabled pre-launch) as you suggested. The PHP introduction classes are intentionally kept (should_show() => false) so their ids stay registered for the /introductions/{id}/seen route — removing a class, unlike the dead view files, could break a Premium version that interacts with the introductions system (thread 🧵) .
Disables the Premium "Your first brand analysis is free!" modal the same way as the post-launch modal, per the UX follow-up on the issue. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the now-unreferenced post-launch and free-trial modal component files (per PR review). The PHP introduction classes are kept (should_show() => false) so their ids stay registered in the collector and the introductions "seen" REST route keeps validating them — this avoids breaking any Premium version that interacts with the introductions system. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the already-disabled pre-launch modal component too, so no dead disabled-modal component files remain. Its PHP introduction class is kept (should_show() => false), matching the post-launch and free-trial handling. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Coverage Report for CI Build 0Warning Build has drifted: This PR's base is out of sync with its target branch, so coverage data may include unrelated changes. Warning No base build found for commit Coverage: 46.425%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats💛 - Coveralls |
| * | ||
| * @return string The ID. | ||
| */ | ||
| public function get_id() { |
There was a problem hiding this comment.
should these files not be moved to the deprecated folder?
There was a problem hiding this comment.
Actually I've checked across Premium: trunk, and older zips to be 'sure' and found zero references to ai-brand-insights-free-trial/ai-brand-insights-post-launch (or their class/component names) anywhere, PHP or compiled JS. Since these aren't public API and nothing in Premium depends on the ids, i think it's safe to remove the two classes outright instead of moving them to src/deprecated/(thread 🧵).
Removing the ids just makes the "seen" call a clean no-op 400 instead of succeeding. No plugin break.
Their should_show() already returns false and the JS modal components were already removed. Verified against Premium's trunk, 28.1/28.2-RC1, and the shipped 27.6/27.9 release zips that nothing references these ids or class names, so keeping them around is unnecessary. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Removes the AI Brand Insights modals/classes/tests and image that #23439 deleted from trunk, plus stray wordpress-urls (class-wpseo-utils) and yarn.lock edits, so this PR only contains the guided-tour work. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Context
This disables the the "Discover Brand Insights now" modal.
Summary
This PR can be summarized in the following changelog entry:
Relevant technical choices:
AI_Brand_Insights_Post_Launch::should_show()(Free) andAI_Brand_Insights_Free_Trial::should_show()(Premium) now returnfalse(methods marked@codeCoverageIgnore), mirroringAI_Brand_Insights_Pre_Launch.initialize.jscomponent map, their now-obsolete unit tests are removed, and the now-unused modal component files are deleted (including the already-disabledai-brand-insights-pre-launch, so no dead component files remain).Test instructions
Test instructions for the acceptance test before the PR gets merged
This PR can be acceptance tested by following these steps:
Reset the introductions "seen" state so the modal can show. Reset via the database / WP-CLI (or use a brand-new admin user):
wp user meta delete <admin-login> _yoast_wpseo_introductionsplugin-development-docker, run this via the wrapper script instead:docker exec basic-wordpress wp user meta delete admin _yoast_wpseo_introductionsDELETE FROM wp_usermeta WHERE meta_key = '_yoast_wpseo_introductions' AND user_id = <admin-id>;This affects two modals: "Discover Brand Insights now" (Free, no Premium subscription) and "Your first brand analysis is free!" (Premium). Test each on the matching setup.
First, on
trunk(before this change):Then, on this branch:
grunt build:dev).Relevant test scenarios
Test instructions for QA when the code is in the RC
Impact check
This PR affects the following parts of the plugin, which may require extra testing:
Other environments
[shopify-seo], added test instructions for Shopify and attached theShopifylabel to this PR.[yoast-doc-extension], added test instructions for Yoast SEO for Google Docs and attached theGoogle Docs Add-onlabel to this PR.Documentation
Quality assurance
grunt build:imagesand committed the results, if my PR introduces or edits images or SVGs.Innovation
Fixes #23431